package model;

public class Applicant {

	public String toString() {
		return "Applicant (Printing from applicant class.... does this work?)";
	}
	
	// NAME
	private String first_name;
	private String middle_initial;
	private String last_name;
	private int app_num;
	private int userId;
	private int PID;
	
	// CITIZEN
	private String citizenship;
	private String country_of_residence;
	
	// ADDRESS
	private String city;
	private String street;
	private String state;
	private boolean hasState = false;


	private String phone_number;
	private String zip_code;
	private String area_code;
	private String country_phone_code;
	private String address;
	
	
	// RESIDENCE
	private String united_states_residency;
	// OTHER
	private String specialization;
	private boolean domestic_bool;
	private String domestic;

	
	/*
	 * Getter / Setter Methods
	 */
	
	public void setAddress(String address) {
		this.address = address;
	}
	
	public String getAddress(){
		return address;
	}
	
	public void setName(String first, String middle, String last) {
		this.first_name = first;
		this.middle_initial = middle;
		this.last_name = last;
	}
	
	public String getName() {
		String name = first_name + " " + middle_initial + " " + last_name;
		return name;
	}
	
	public void setAddress(String street, String city, String state, String zip_code, String country_phone_code, String area_code, String phone_number ) {
		this.street = street;
		this.city = city;
		this.state = state;
		this.country_phone_code = country_phone_code;
		this.zip_code = zip_code;
		this.area_code = area_code;
		this.phone_number = phone_number;
	}
	
	/**
	 * @return the first_name
	 */
	public String getFirst_name() {
		return first_name;
	}

	/**
	 * @return the middle_initial
	 */
	public String getMiddle_initial() {
		return middle_initial;
	}

	/**
	 * @return the last_name
	 */
	public String getLast_name() {
		return last_name;
	}

	/**
	 * @return the city
	 */
	public String getCity() {
		return city;
	}

	/**
	 * @return the street
	 */
	public String getStreet() {
		return street;
	}

	/**
	 * @return the phone_number
	 */
	public String getPhone_number() {
		return phone_number;
	}

	/**
	 * @return the zip_code
	 */
	public String getZip_code() {
		return zip_code;
	}

	/**
	 * @return the area_code
	 */
	public String getArea_code() {
		return area_code;
	}

	/**
	 * @return the country_phone_code
	 */
	public String getCountry_phone_code() {
		return country_phone_code;
	}

	public String getAddressDomestic() {
		String address = street + " " + city + ", " + state + " " + zip_code + ", " + area_code + "-" + phone_number;
		return address;
	}
	
	public String getAddressForeign() {
		String address = street + " " + city + "," + zip_code + ", " + country_phone_code + "-" + area_code + "-" + phone_number;
		return address;
	}
	
	/**
	 * @return the state
	 */
	public String getState() {
		return state;
	}
	
	public void setState(String state) {
		this.state = state;
		this.hasState = true;
	}
	public boolean hasState(){
		return this.hasState;
	}
	
	public String getCitizenship() {
		return citizenship;
	}
	public void setCitizenship(String citizenship) {
		this.citizenship = citizenship;
	}
	public String getCountry_of_residence() {
		return country_of_residence;
	}
	public void setCountry_of_residence(String country_of_residence) {
		this.country_of_residence = country_of_residence;
	}
	public String getUnited_states_residency() {
		return united_states_residency;
	}
	public void setUnited_states_residency(String united_states_residency) {
		this.united_states_residency = united_states_residency;
	}
	public boolean isDomestic() {
		return domestic_bool;
	}

	public void setDomestic(boolean domestic) {
		this.domestic_bool = domestic;
	}
	
	public String getDomestic() {
		return domestic;
	}

	public void setDomestic(String domestic) {
		this.domestic = domestic;
	}

	public String getSpecialization() {
		return specialization;
	}
	public void setSpecialization(String specialization) {
		this.specialization = specialization;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public int getPID() {
		return PID;
	}

	public void setPID(int pid2) {
		this.PID = pid2;
		
	}
	
	public static String printApplicant(Applicant applicant){
		String applicantString = "Name: " + applicant.getName() +" <br/>";
		applicantString = applicantString + "PID: "+applicant.getPID() +" <br/>";
		applicantString = applicantString + "Country of Citizenship: " + applicant.getCitizenship()  +" <br/>";
		applicantString = applicantString + "Country of Residence: " + applicant.getCountry_of_residence() +" <br/>";
		if(applicant.getState() != null){ 
			applicantString = applicantString + "Address: " + applicant.getAddressDomestic()+" <br/>";
		}else{
			applicantString = applicantString + "Address: " + applicant.getAddressForeign()+" <br/>";
			} 
		applicantString = applicantString + applicant.getDomestic()+" <br/>";
		applicantString = applicantString + "Specialization: " + applicant.getSpecialization() +" <br/>";
		
		
		return applicantString;
		
	}
	
	
	
}



	